#ifndef SRANDINITIALIZER_HPP
#define SRANDINITIALIZER_HPP

#include <ctime>
#include <cstdlib>

namespace TermStructure
{
    //! A class maintains that srand() is called only once
	class _srandInitializer
	{
	public:
		static int IsInitializerd;
        //! Safely call srand() without worrying that it is already called.
		static void SafeInitialize()
		{
			if(IsInitializerd == 0)
			{
				std::srand(std::time(NULL));
				_srandInitializer::IsInitializerd = 1;
				return;
			}
			else return;
		}
	};
}

#endif